<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/iconfont.css">
		<style>
			.mui-content-padded{margin:5px 0 0 0;}
			.mui-row-list span{float: left; line-height:33px; width:20%;}
			.mui-row-list select{float: left; line-height:14px; font-size:14px; margin-top:2px; margin-left: 5px;}
			.mui-btn-block{margin-bottom:0; padding:6px;}
			.mui-col-sm-12{ border-top: 1px solid #D1D1D1; width:100%; padding-top:5px; font-size:14px;}
			input[type="text"]{height:30px; margin-bottom: 5px;}
			form:before{ background: none !important; border: none !important;}
			/*弹窗样式*/
			.mui-scroll-wrapper{height:8rem;}
			.mui-popover .mui-scroll-wrapper{margin:0;}
			.user{text-align:center; background-color: #ffffff;margin-bottom: 10px; padding: 10px;}
			.user b{margin-right: 10px; color: #007aff; line-height: 32px; font-size: 16px; font-family: "微软雅黑";}
			.user a{margin-right: 10px; color: #000000; line-height: 32px; font-size: 16px; font-family: "微软雅黑";}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">患者信息</h1>
			<a id="menu" class="mui-action-menu mui-icon mui-icon-bars mui-pull-right" href="#topPopover"></a>
		</header>
		<!--右上角弹出菜单-->
			<div id="topPopover" class="mui-popover">
				<div class="mui-popover-arrow"></div>
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<ul class="mui-table-view">
							<li class="mui-table-view-cell"><a href="javascript:void(0)" onclick="homeback()">返回首页</a></li>
							<li class="mui-table-view-cell"><a href="javascript:void(0)" onclick="news_delet()">删除记录</a></li>
							<!-- <li class="mui-table-view-cell"><a href="javascript:void(0)" onclick="follow_back()">随访查询</a></li> -->
						</ul>
					</div>
				</div>
			</div>
		<div class="mui-conten" style="margin-top:50px;">
			<div style="width:98%; margin: 0 auto;">
					<div class="mui-content-padded">
						<div class="user">
							<span class="mui-icon mui-icon-contact" style="font-size:45px; color: #007AFF;"></span>
							<span><b id="name"></b><a id="sex"></a><a id="age"></a></span>
						</div>
						<div id="item1mobile" class="mui-control-content mui-active">
							<ul class="mui-table-view">
								<div class="mui-row">
									<div class="mui-col-sm-12 mui-col-xs-12">
										<li class="mui-table-view-cell">
											<a class="mui-navigate-right" href="javascript:;" onclick="basic()">
												<div style="float: left; font-size: 16px;">
													基本信息
												</div>
												<div style="float: right; margin-right:20px; color:#999999;">随访日期/方式+症状</div>
											</a>
										</li>
									</div>
									<div class="mui-col-sm-12 mui-col-xs-12" id="signs">
										<li class="mui-table-view-cell">
											<a class="mui-navigate-right" href="javascript:;" onclick="signs()">
												<div style="float: left; font-size: 16px;">体征录入</div>
												<div style="float: right; margin-right:20px; color:#999999;">血压+体重+身高</div>
											</a>
										</li>
									</div>
									<div class="mui-col-sm-12 mui-col-xs-12">
										<li class="mui-table-view-cell">
											<a class="mui-navigate-right" href="javascript:;" onclick="habit()">
												<div style="float: left; font-size: 16px;">生活方式</div>
												<div style="float: right; margin-right:20px; color:#999999;">吸烟量+饮酒量+运动</div>
											</a>
										</li>
									</div>
									<div class="mui-col-sm-12 mui-col-xs-12">
										<li class="mui-table-view-cell">
											<a class="mui-navigate-right" href="javascript:;" onclick="auxiliary()">
												<div style="float: left; font-size: 16px;">辅助检查</div>
												<div style="float: right; margin-right:20px; color:#999999;">血糖+心电图+血红蛋白</div>
											</a>
										</li>
									</div>
									<div class="mui-col-sm-12 mui-col-xs-12" id="other">
										<li class="mui-table-view-cell">
											<a class="mui-navigate-right" href="javascript:;" onclick="other()">
												<div style="float: left; font-size: 16px;">其他信息</div>
												<div style="float: right; margin-right:20px; color:#999999;">用药情况+随访分类</div>
											</a>
										</li>
									</div>
								</div>
							</ul>
							<!-- <div style="background-color: #FFFFFF; margin-top: 10px; padding:10px;">
								上传照片
								<div style="margin-top: 10px;">
									<img src="../images/1.jpg" width="90">
									<a href="" style="display:inline-block; text-align: center;">
										<span class="mui-icon mui-icon-image"></span><br>
										上传图片<br>最多3张
									</a>
								</div>
							</div> -->
						</div>
					</div>
			</div>
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/jquery.min-1.11.1.js"></script>
		<script src="../js/request.js"></script>
		<script type="text/javascript">
			mui.init({
				beforeback: function() {
			　　　　 //获得父页面的webview
					var list = plus.webview.currentWebview().opener();
			　　　　 //触发父页面的自定义事件(refresh),从而进行刷新
					mui.fire(list, 'refresh');
					//返回true,继续页面关闭逻辑
					return true;
				}
			})
			//获取变量
			var visitId = null;
			var ehrId = null;
			var conditions = "";
			var listdata = "";
			var first = "";
			var second = "";
			//返回上级页面传送参数
			function plusReady(){
                 mui("body").on("tap",".jump",function(){
					 mui.openWindow({
						  url:"follow_up_basic_tb.html",
						  id:"follow_up_basic_tb"
					 })
                })
            }
            if(window.plus){
                  plusReady();
            }else{
                 document.addEventListener("plusready",plusReady,false);
             }
             //返回回来要执行的方法   
             function fun1(e){
                 var val=e.detail.inputVal
                 visitId = val
             }
             //自定义窗体事件  doit 要和b页面定义的 事件名称一致   
            window.addEventListener('doit',fun1);
			mui.plusReady(function(){
				var self = plus.webview.currentWebview()
				var datat = JSON.stringify(self.data);
				listdata = self.data;
				var selfdata = JSON.parse(listdata)
				conditions =self;
				visitId = self.visitId;
				ehrId = selfdata.ehrId;
				//console.log(visitId)
				document.getElementById("name").innerHTML = selfdata.name;
				document.getElementById("sex").innerHTML = selfdata.sex;
				var date0 = new Date(selfdata.birthday);
				var date1 = new Date();
				var year0=date0.getFullYear(); 
				var year1=date1.getFullYear(); 
				var patage = year1-year0;
				document.getElementById("age").innerHTML = patage;
				if(conditions.symname == "中医体质"){
					$("#other").hide();
					$("#signs").hide();
				}
				if(visitId != null){
					if(conditions.symname == "高血压专档"){
						//第一次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/HtMGVisitRecord/getMGVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datafirst) {
								console.log(JSON.stringify(datafirst))
								if(datafirst.status==1){
									first = JSON.stringify(datafirst.rows[0]);
								}else{
									alert(datafirst.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
						//第二次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/HtPersonAnswer/getAnswerList",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datasecond) {
								console.log(JSON.stringify(datasecond))
								if(datasecond.status==1){
									second = JSON.stringify(datasecond.rows);
								}else{
									alert(datasecond.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
					}else if(conditions.symname == "糖尿病专档"){
						//第一次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/DiabetesMGVisitRecord/getMGVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datafirst) {
								if(datafirst.status==1){
									first = JSON.stringify(datafirst.rows[0]);
								}else{
									alert(datafirst.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
						//第二次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/DiabetesPersonAnswer/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datasecond) {
								if(datasecond.status==1){
									second = JSON.stringify(datasecond.rows);
								}else{
									alert(datasecond.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
					}else if(conditions.symname == "肺结核专档"){
						//第一次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/TbVisit/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datafirst) {
								console.log(JSON.stringify(datafirst))
								if(datafirst.status==1){
									first = JSON.stringify(datafirst.rows[0]);
								}else{
									alert(datafirst.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
						//第二次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/TbVisitAddition/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datasecond) {
								if(datasecond.status==1){
									second = JSON.stringify(datasecond.rows);
								}else{
									alert(datasecond.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
					}else if(conditions.symname == "中医体质"){
						//第一次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/OldsterVisitRecord/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datafirst) {
								if(datafirst.status==1){
									first = JSON.stringify(datafirst.rows[0]);
								}else{
									alert(datafirst.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
						//第二次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/OldsterVisitAnswer/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datasecond) {
								if(datasecond.status==1){
									second = JSON.stringify(datasecond.rows);
									console.log(second)
								}else{
									alert(datasecond.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
					}else if(conditions.symname == "精神病专档"){
						console.log(ehrId)
						console.log(visitId)
						//第一次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/psychosisVisitRecord/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datafirst) {
								if(datafirst.status==1){
									first = JSON.stringify(datafirst.rows[0]);
									console.log(first)
								}else{
									alert(datafirst.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
						//第二次提交内容获取	
						$.ajax({
							type: 'post',
							url:getRequestUrl.url+"/mobile/ehr/psychosisVisitAnswer/getVisitDetail",
							data:{
								ehr_id: ehrId,
								visit_id: visitId
							},
							dataType:"json",
							success : function(datasecond) {
								if(datasecond.status==1){
									second = JSON.stringify(datasecond.rows);
									console.log(second)
								}else{
									alert(datasecond.message);
								}
							},
							error:function(xhr,type,errorThrown){
								
							}
						})
					}
				}
			})
			function basic(){
				if(conditions.symname == "高血压专档"){
					mui.openWindow({
						url: 'follow_up_basic.html', 
						id:'basic',
						extras:{
							data:listdata,
							nextTime:conditions.nextTime,
							first:first,
							second:second
						}
					});
				}else if(conditions.symname == "糖尿病专档"){
					mui.openWindow({
						url: 'follow_up_basic_diabetes.html', 
						id:'basic',
						extras:{
							data:listdata,
							nextTime:conditions.nextTime,
							first:first,
							second:second
						}
					});
				}else if(conditions.symname == "肺结核专档"){
					mui.openWindow({
						url: 'follow_up_basic_tb.html', 
						id:'basic',
						extras:{
							data:listdata,
							arcid:conditions.arcid,
							nextTime:conditions.nextTime,
							first:first,
							second:second
						}
					});
				}else if(conditions.symname == "精神病专档"){
					mui.openWindow({
						url: 'follow_up_basic_Mental.html', 
						id:'basic',
						extras:{
							data:listdata,
							nextTime:conditions.nextTime,
							first:first,
							second:second
						}
					});
				}else if(conditions.symname == "中医体质"){
					mui.openWindow({
						url: 'follow_up_basic_elderly.html', 
						id:'basic',
						extras:{
							data:listdata,
							nextTime:conditions.nextTime,
							first:first,
							second:second
						}
					});
				}	
			}
			function signs(){	
				if(visitId == null){
					alert("请先提交基本信息")
				}else{
					if(conditions.symname == "高血压专档"){
						mui.openWindow({
							url: 'follow_up_signs.html', 
							id:'signs',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "糖尿病专档"){
						mui.openWindow({
							url: 'follow_up_signs_diabetes.html', 
							id:'signs',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "肺结核专档"){
						mui.openWindow({
							url: 'follow_up_signs_tb.html', 
							id:'signs',
							extras:{
								data:listdata,
								arcid:conditions.arcid,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "精神病专档"){
						mui.openWindow({
							url: 'follow_up_signs_Mental.html', 
							id:'signs',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "中医体质"){
						mui.openWindow({
							url: 'follow_up_signs_elderly.html', 
							id:'signs',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}	
				}
			}
			function habit(){
				if(visitId == null){
					alert("请先提交基本信息")
				}else{
					if(conditions.symname == "高血压专档"){
						mui.openWindow({
							url: 'follow_up_habit.html', 
							id:'habit',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "糖尿病专档"){
						mui.openWindow({
							url: 'follow_up_habit_diabetes.html', 
							id:'habit',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "肺结核专档"){
						mui.openWindow({
							url: 'follow_up_habit_tb.html', 
							id:'habit',
							extras:{
								data:listdata,
								arcid:conditions.arcid,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "精神病专档"){
						mui.openWindow({
							url: 'follow_up_habit_Mental.html', 
							id:'habit',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "中医体质"){
						mui.openWindow({
							url: 'follow_up_habit_elderly.html', 
							id:'habit',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}	
				}
			}
			function auxiliary(){
				if(visitId == null){
					alert("请先提交基本信息")
				}else{
					if(conditions.symname == "高血压专档"){
						mui.openWindow({
							url: 'follow_up_auxiliary.html', 
							id:'auxiliary',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "糖尿病专档"){
						mui.openWindow({
							url: 'follow_up_auxiliary_diabetes.html', 
							id:'auxiliary',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "肺结核专档"){
						mui.openWindow({
							url: 'follow_up_auxiliary_tb.html', 
							id:'auxiliary',
							extras:{
								data:listdata,
								arcid:conditions.arcid,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "精神病专档"){
						mui.openWindow({
							url: 'follow_up_auxiliary_Mental.html', 
							id:'auxiliary',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "中医体质"){
						mui.openWindow({
							url: 'follow_up_auxiliary_elderly.html', 
							id:'auxiliary',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}	
				}
			}
			function other(){
				if(visitId == null){
					alert("请先提交基本信息")
				}else{
					if(conditions.symname == "高血压专档"){
						mui.openWindow({
							url: 'follow_up_other.html', 
							id:'other',
							extras:{
								data:listdata,
								symname:conditions,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "糖尿病专档"){
						mui.openWindow({
							url: 'follow_up_other_diabetes.html', 
							id:'other',
							extras:{
								data:listdata,
								symname:conditions,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "肺结核专档"){
						mui.openWindow({
							url: 'follow_up_other_tb.html', 
							id:'other',
							extras:{
								data:listdata,
								symname:conditions,
								arcid:conditions.arcid,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}else if(conditions.symname == "精神病专档"){
						mui.openWindow({
							url: 'follow_up_other_Mental.html', 
							id:'other',
							extras:{
								data:listdata,
								visitdata:visitId,
								first:first,
								second:second
							}
						});
					}
				}
			}
			function homeback(){
				  //关闭当前窗口
				  var win_add=plus.webview.currentWebview();
				  plus.webview.close(win_add);
				  //获取目标页面//打开关于页面
				  mui.openWindow({
					url: '../index.html', 
					id:'index',
					extras:{
						name:'homeback'
					}
				  });
			}
			function news_delet(){
				//关闭当前窗口
				var win_add=plus.webview.currentWebview();
				plus.webview.close(win_add);
			}
			function follow_back(){
				
			}
		</script>
	</body>

</html>